﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Brjostagjof_H4.Models.ContactUs>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
		Brjóstagjöf.is | Ábendingar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Eldri ábendingar</h3>
    <table id="main-table">
        <tr>

        <td id="main-table-left">
        <% if (Model.Count() > 0)
        { %>
            <table id="main-table-contact">
                <tr>
                    <th></th>
                    <th>
                        Fyrirsögn
                    </th>
                    <th>
                        Ábending
                    </th>
                    <th>
                        Netfang
                    </th>
                    <th>
                        Hvenær sent
                    </th>
                </tr>

            <% foreach (var item in Model) { %>
    
                <tr>
                    <td class="edit-links">
                      <%: Html.ActionLink("Sjá Nánar", "ContactUsShowDetail", new { id=item.ID })%> |
                        <%: Html.ActionLink("Eyða","ContactUsDelete",new { id = item.ID } ) %>
                    </td>
                    <td>
                        <%: item.subj %>
                    </td>
                    <td>
                        <%: item.txt %>
                    </td>
                    <td>
                        <%: item.email %>
                    </td>
                    <td>
                        <%: item.posted %>
                    </td>
                </tr>
    
            <% } %>

            </table>
            <% }
            else
            { %>
                 <p>Engar nýjar ábendingar.</p>
         <% } %>
            </td>

            <td id="main-table-right">
                <div class="options">
                    <% if (User.IsInRole("Administrators")){Html.RenderPartial("~/Views/Home/ProfileAdminMenu.ascx", "Model");} %>
                    <% else if (User.IsInRole("Professionals")) { Html.RenderPartial("~/Views/Home/ProfileProMenu.ascx", "Model"); } %>
                    <% else { Html.RenderPartial("~/Views/Home/ProfileMenu.ascx", "Model"); } %>
                </div>
            </td>

        </tr>
    </table>    

</asp:Content>

